# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: team/kde <bribbers@disroot.org>

# The group tag is just to easily find this APKBUILD by some scripts for automation
# group=kde-frameworks-old
pkgname=solid5
pkgver=5.115.0
pkgrel=0
pkgdesc="Hardware integration and detection"
# armhf blocked by qt5-qtdeclarative
arch="all !armhf"
url="https://community.kde.org/Frameworks"
license="LGPL-2.1-only OR LGPL-3.0-only"
depends_dev="qt5-qtdeclarative-dev"
makedepends="$depends_dev
	bison
	doxygen
	eudev-dev
	extra-cmake-modules
	flex-dev
	qt5-qttools-dev
	samurai
	udisks2-dev
	upower-dev
	"
_repo_url="https://invent.kde.org/frameworks/solid.git"
source="https://download.kde.org/stable/frameworks/${pkgver%.*}/solid-$pkgver.tar.xz"
subpackages="$pkgname-dev $pkgname-libs:_libs $pkgname-doc $pkgname-lang"
builddir="$srcdir/solid-$pkgver"

replaces="solid<=5.110.0-r0"

build() {
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=RelWithDebInfo \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DBUILD_QCH=ON
	cmake --build build
}

check() {
	# solidmttest is broken
	ctest --test-dir build --output-on-failure -E "solidmttest"
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

_libs() {
	# workaround: need to specify replaces, otherwise upgrade will fail
	replaces="solid-libs<=5.110.0-r0"
	default_libs
}

sha512sums="
727fe483124edcfbc56aad2f3988c1499b1d100173279a0da3477a12857e0381b845a9efa1d1827ad24a96557d3a2d0ce67b09e53571c37637dbb4aac4dff4d1  solid-5.115.0.tar.xz
"
